package com.css.openapi.controller;


import com.css.common.core.constant.ApiAccess;
import com.css.openapi.BO.*;
import com.css.openapi.service.JctyDdxxService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "正向开票服务Api")
@RestController
@RequestMapping("/zxkp")
public class ZxkpController {

    @Resource
    private JctyDdxxService jctyDdxxService;

    /**
     * 蓝字发票开具接口
     *
     * @param param 请求参数
     * @return 开票结果
     */
    @PostMapping("/issueBlueInvoice")
    @ApiAccess
    public IssueBlueInvoiceResponse issueBlueInvoice(@RequestBody IssueBlueInvoiceRequest param) {
        return jctyDdxxService.issueBlueInvoice(param);
    }


    /**
     * 订单状态查询接口
     *
     * @param param 请求参数
     * @return 订单状态信息
     */
    @PostMapping("/queryOrderStatus")
    @ApiAccess
    public QueryOrderStatusResponse queryOrderStatus(@RequestBody QueryOrderStatusRequest param) {
        return jctyDdxxService.queryOrderStatus(param);
    }

    /**
     * 发票下载接口
     *
     * @param param 请求参数
     * @return 发票文件下载地址
     */
    @PostMapping("/downloadInvoice")
    @ApiAccess
    public DownloadInvoiceResponse downloadInvoice(@RequestBody DownloadInvoiceRequest param) {
        return jctyDdxxService.downloadInvoice(param);
    }

    /**
     * 换开发票接口
     *
     * @param param 请求参数
     * @return 换开发票结果
     */
    @PostMapping("/replaceInvoice")
    @ApiAccess
    public ReplaceInvoiceResponse replaceInvoice(@RequestBody FpttInfoVO param) {
        return jctyDdxxService.replaceInvoice(param);
    }

    /**
     * 红字发票开具接口
     *
     * @param param 请求参数
     * @return 红字发票开具结果
     */
    @PostMapping("/issueRedInvoice")
    @ApiAccess
    public IssueRedInvoiceResponse issueRedInvoice(@RequestBody IssueRedInvoiceRequest param) {
        return jctyDdxxService.issueRedInvoice(param);
    }
}
